#define row1() init_lcd(0x80)   /* Begin at Line 1 */
#define row2() init_lcd(0xC0)   /* Begin at Line 2 */
#define row3() init_lcd(0x94)   /* Begin at Line 3 */
#define row4() init_lcd(0xD4)   /* Begin at Line 4 */
#define LCD_Clear() init_lcd(0x01)      /* Clear display LCD */
unsigned char w[] = { 0x38,0x0c,0x01,0x06,0x02,0x80};
unsigned char temp,brk;
int32 increase_rot=0;
int32 dum,increase,dummy;
byte const val[]={'0','1','2','3','4','5','6','7','8','9'};

/*======================================================LCD Initialisation============================================*/
void init_lcd(unsigned char j)
{
   output_e (0x00);
   output_d (j);
   output_e (0x02);
   delay_ms (2);
   output_e (0x00);
   delay_ms (2);
}
/*=======================================================Display Function=============================================*/
void display(char s)
{
   output_e (0x01);
   output_d (s);
   output_e (0x03);
   delay_ms (2);
   output_e (0x01);
   delay_ms (2);
}
/*=======================================================Functions For ROW============================================*/
void Lcd_init()
{
unsigned char ir;
   for( ir = 0 ; ir < 6 ; ir++ )
   {
      init_lcd (w[ir]);
   }
}

/*================================================Function to display data on LCD=====================================*/
void LCD_RTC(unsigned char k)
{
   output_e (0x01);
   output_d (((k/16)%10)+0X30);
   output_e (0x03);
   delay_us (10);
   output_e (0x01);
   delay_us (100);

   output_e (0x01);
   output_d ((k%16)+0X30);
   output_e (0x03);
   delay_us (10);
   output_e (0x01);
   delay_us (100);
}

void LCD_digital(unsigned char k)
{
   output_e (0x01);
   output_d (((k/10)%10)+0X30);
   output_e (0x03);
   delay_us (10);
   output_e (0x01);
   delay_us (100);

   output_e (0x01);
   output_d ((k%10)+0X30);
   output_e (0x03);
   delay_us (10);
   output_e (0x01);
   delay_us (100);
}
